package com.headStorm.factory;

public class ReBatchFactory {

    private final Configuration configuration;

    public ReBatchFactory(Configuration configuration){
        this.configuration = configuration;
    }

    public IRebatchService getBatchService(){
        return getBatchServiceFromConfiguration(configuration);
    }

    private IRebatchService getBatchServiceFromConfiguration(Configuration configuration) {
        if("voice".equals(configuration.getType())){
            return new VoiceRebatchService();
        }else if("bill".equals(configuration.getType())){
            return new BillRebatchService();
        }else{
            return new VoiceRebatchService();
        }
    }
}
